package com.linkage.jz.bankruptcy.fragment.Project;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.linkage.jz.bankruptcy.BankruptcyApp;
import com.linkage.jz.bankruptcy.Consts;
import com.linkage.jz.bankruptcy.R;
import com.linkage.jz.bankruptcy.activity.Project.ProZQChangePhoneActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.AddProxyUserActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.DetailOper.ChangerLegalUserNameActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.DetailOper.ChangerZQUserNameActivity;
import com.linkage.jz.bankruptcy.adapter.FileAdapter;
import com.linkage.jz.bankruptcy.bean.TaskAtta;
import com.linkage.jz.bankruptcy.bean.ZQUserDetailBaseInfo;
import com.linkage.jz.bankruptcy.net.BaseSubscriber;
import com.linkage.jz.bankruptcy.net.Network;
import com.linkage.jz.bankruptcy.net.ToastUtil;
import com.linkage.jz.bankruptcy.utils.SPUtils;
import com.linkage.jz.bankruptcy.utils.Utils;
import com.linkage.jz.bankruptcy.widget.PublicNoticeDialog;
import com.linkage.jz.bankruptcy.widget.ZQUserBaseReplyDialog;
import com.linkage.seapeak.base.BaseFragment;

import org.json.JSONObject;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * @author FT
 * @time 2016-07-18 16:49
 * 管理人债权人详情 tab-基础详情
 */

// JUMP 
public class ZQUserBaseDetail_ZQRShowFragment extends BaseFragment {
    RecyclerView mRecyclerView;
    private Context context;
    private int mPage;
    public static final String MERCHANT_DETAILS_PAGE = "MERCHANT_DETAILS_PAGE";
    private DemoAdapter mAdapter;

    private ZQUserBaseReplyDialog dialog;
    List<String> mFoodData;
    List<String> mMovieData;
    List<String> mHaveFunData;
    List<String> mEvaluationData;
//    private static ZQUserInfo mInfo;
    private TextView tv_editname;
    private static String mProid;
    private static String creditorId;
    private  List<ZQUserDetailBaseInfo>  zqUserDetailInfo;

    private RecyclerView mImgRecyclerView1;
    private List<TaskAtta> mImgList1 = new ArrayList<>();
    private FileAdapter mImgAdapter1;

    private RecyclerView mImgRecyclerView2;
    private List<TaskAtta> mImgList2 = new ArrayList<>();
    private FileAdapter mImgAdapter2;
    private static Activity mActivity;

    private RecyclerView mImgRecyclerView3;
    private List<TaskAtta> mImgList3 = new ArrayList<>();
    private FileAdapter mImgAdapter3;

    private RecyclerView mImgRecyclerView4;
    private List<TaskAtta> mImgList4 = new ArrayList<>();
    private FileAdapter mImgAdapter4;


    private RecyclerView mImgRecyclerView10;
    private List<TaskAtta> mImgList10 = new ArrayList<>();
    private FileAdapter mImgAdapter10;

    private RecyclerView mImgRecyclerView11;
    private List<TaskAtta> mImgList11 = new ArrayList<>();
    private FileAdapter mImgAdapter11;

    @Override
    public void onResume() {
        super.onResume();
        getData();
    }


    private static ZQUserDetailBaseInfo mInfo;

    public static ZQUserBaseDetail_ZQRShowFragment newInstance(ZQUserDetailBaseInfo info) {
        Bundle args = new Bundle();
//        args.putInt(MERCHANT_DETAILS_PAGE, page);
//        mInfo = info;
//        creditorId = creditorid;
//        mProid = proid;
        mInfo = info;
        ZQUserBaseDetail_ZQRShowFragment tripFragment = new ZQUserBaseDetail_ZQRShowFragment();
        tripFragment.setArguments(args);
        return tripFragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPage = getArguments().getInt(MERCHANT_DETAILS_PAGE);
        context = getActivity().getApplicationContext();
        zqUserDetailInfo = new ArrayList<ZQUserDetailBaseInfo>();
        setData();
//        getData();
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_zq_detail_base, container, false);
        mRecyclerView = (RecyclerView) view.findViewById(R.id.mRecyclerView);
        switch (mPage){
            case 0:
                initAdapter(zqUserDetailInfo);
                break;

        }
        zqUserDetailInfo.add(mInfo);
        mAdapter.notifyDataSetChanged();
//        tv_editname = vie

        return view;
    }

    private void setData(){
        mFoodData = new ArrayList<>();
        for(int i=0; i<1;i++){
            mFoodData.add("美食"+i);
        }
        mMovieData = new ArrayList<>();
        for(int i=0; i<1;i++){
            mMovieData.add("电影"+i);
        }
        mHaveFunData = new ArrayList<>();
        for(int i=0; i<1;i++){
            mHaveFunData.add("玩乐"+i);
        }
        mEvaluationData = new ArrayList<>();
        for(int i=0; i<1;i++){
            mEvaluationData.add("评价"+i);
        }
    }

    private PublicNoticeDialog noticeDialog;
    /**
     * 设置RecyclerView属性
     */
    private void initAdapter(List<ZQUserDetailBaseInfo> data) {
//        mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LISTAL_LIST));

        mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
        mAdapter = new DemoAdapter(getActivity(), R.layout.fragment_zq_detail_base_item, data);
        mAdapter.openLoadAnimation();

        mRecyclerView.setAdapter(mAdapter);//设置adapter
        //设置item点击事件
        mAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
            @Override
            public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
                final ZQUserDetailBaseInfo info = new ZQUserDetailBaseInfo();
                switch (view.getId()) {

                    case R.id.btn_commit:
//                        EditManagerUserInfoActivity.start(getActivity(),mInfo);
                        dialog = new ZQUserBaseReplyDialog(getActivity(),onClickListener);
                        dialog.show();
                        break;

                    case R.id.tv_zq_setuser:
                        noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                            @Override
                            public void onClick(View v) {
                                if (v.getId() == R.id.btn_save_notice) {
                                    setUserSetting();
                                }
                                noticeDialog.dismiss();
                            }
                        }, 1, "配置系统账号须知", "设置系统账号须知，请妥善保管账号，此账号仅能使用账号密码方式登录系统，登录后进入个人中心更改密码。设置系统账号须知，请妥善保管账号，此账号仅能使用账号密码方式登录系统，登录后进入个人中心更改密码。",
                                "取消", "生成");
                        noticeDialog.show();
                        break;
                    case R.id.tv_zq_phone_add:
                        ProZQChangePhoneActivity.start(getActivity(),mProid,creditorId);
                        break;

                    case R.id.tv_editname1:
                    case R.id.tv_editname2:
                    case R.id.tv_editname3:
                    case R.id.tv_editname4:
                    case R.id.tv_editname5:
                    case R.id.tv_editname6:


                        if(zqUserDetailInfo != null && zqUserDetailInfo.size()>0)
                        {
                            final ZQUserDetailBaseInfo infotmp1 = zqUserDetailInfo.get(0);
                            noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                                    if (v.getId() == R.id.btn_save_notice) {
                                        ChangerZQUserNameActivity.start(getActivity(), infotmp1, "0", 0);
                                    }
                                    noticeDialog.dismiss();
                                }
                            }, 1, "提示", "该操作须取得债权人授权或依据文件",
                                    "暂未取得", "已取得");
                            noticeDialog.show();
                        }


                        break;

                    case R.id.tv_change_legalname1:


                        if(zqUserDetailInfo != null && zqUserDetailInfo.size()>0)
                        {
                            final ZQUserDetailBaseInfo infotmp2 = zqUserDetailInfo.get(0);
                            noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                                    if (v.getId() == R.id.btn_save_notice) {
                                        ChangerLegalUserNameActivity.start(getActivity(), infotmp2, 0, 0);
//                                        ChangerLegalRepActivity.start(getActivity(), infotmp2, "0", 0,0);
                                    }
                                    noticeDialog.dismiss();
                                }
                            }, 1, "提示", "该操作须取得债权人授权或依据文件",
                                    "暂未取得", "已取得");
                            noticeDialog.show();
                        }


                        break;
                    case R.id.tv_change_proxy_legalname1:
                        final ZQUserDetailBaseInfo infotmp3 = zqUserDetailInfo.get(0);
                        noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                            @Override
                            public void onClick(View v) {
                                if (v.getId() == R.id.btn_save_notice) {
//                                    ChangerLegalRepActivity.start(getActivity(), infotmp3, "0", 0,0);
                                    ChangerLegalUserNameActivity.start(getActivity(), infotmp3, 0, 0);
                                }
                                noticeDialog.dismiss();
                            }
                        }, 1, "提示", "该操作须取得债权人授权或依据文件",
                                "暂未取得", "已取得");
                        noticeDialog.show();


                        break;

                    case R.id.img_group_legal_cardnum:
                        break;
                    //变更代理人
                    case R.id.tv_change_proxyname1:
                    case R.id.tv_person_base_pyname_py_4:
                    case R.id.tv_person_base_pyname_py_5:

                        final ZQUserDetailBaseInfo infotmp2 = zqUserDetailInfo.get(0);
                        noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                            @Override
                            public void onClick(View v) {
                                if (v.getId() == R.id.btn_save_notice) {
                                    AddProxyUserActivity.start(getActivity(), mProid, creditorId, 1, 0);
                                }
                                noticeDialog.dismiss();
                            }
                        }, 1, "提示", "该操作须取得债权人授权或依据文件",
                                "暂未取得", "已取得");
                        noticeDialog.show();
                        break;

                }
            }
        });

    }

    private View.OnClickListener onClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            switch (v.getId()) {

                case R.id.btn_chancel:
                    dialog.dismiss();
                    break;
                case R.id.btn_save:
                    String msg = dialog.text_reason.getText().toString().trim();
                    String status = "1";
                    if(dialog.cb_nopass.isChecked())
                    {
                        status = "2";
                    }
                    String notifyTypes="";
                    if(dialog.send_msg.isChecked() && dialog.send_phone.isChecked())
                    {
                        notifyTypes = "0,1";
                    }else if(dialog.send_msg.isChecked() ){
                        notifyTypes = "0";
                    }else{
                        notifyTypes = "1";
                    }


//                    addZQUser(name,phone);
                    applyPerson(status,msg,notifyTypes);
                    dialog.dismiss();
                    break;


            }
        }
    };

    public void applyPerson(String status,String msg,String notifyTypes)
    {
        if(BankruptcyApp.tokeninfo == null|| BankruptcyApp.tokeninfo.getToken() == null)
        {
            return;
        }

        OkHttpClient okHttpClient = new OkHttpClient();
//        HashMap<String, String> params = new HashMap<String, String>();
        Random random = new Random();
        String rom = random.nextLong()+"";
        String timestamp =System.currentTimeMillis()+"";
        String userToken = SPUtils.getInstance(Consts.SPNAME).getString("userToken","");
        String userId = SPUtils.getInstance(Consts.SPNAME).getString("userId","");

        String no = zqUserDetailInfo.get(0).getId();
        RequestBody requestBody = new FormBody.Builder()
                .add("appid","1000000001")
                .add("nonce",rom)
                .add("timestamp", timestamp)
                .add("token", BankruptcyApp.tokeninfo.getToken())
                .add("userToken",userToken)
                .add("creditorId", creditorId)
                .add("status", status)
                .add("msg",msg)
                .add("notifyTypes", notifyTypes)
                .build();

        String url = Consts.WEBURL_INDENTITYAUDIT;
        Request request = new Request.Builder()
                .url(url)
                .post(requestBody)
                .build();

        okHttpClient.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
//                shapeLoadingDialog.dismiss();
//                Log.d(TAG, "onFailure: " + e.getMessage());
                getActivity().runOnUiThread(new Runnable(){

                    @Override
                    public void run() {
                        //更新UI
                        Toast.makeText(getActivity(),"保存失败",Toast.LENGTH_SHORT).show();

                    }

                });
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {
//                Log.d(TAG, response.protocol() + " " +response.code() + " " + response.message());
                Headers headers = response.headers();
//

                String str = response.body().string();
                try{
                    final JSONObject object = new JSONObject(str);
                    if(object.optInt("code") == 0)
                    {
                        getActivity().runOnUiThread(new Runnable() {

                            @Override
                            public void run() {
                                //更新UI
                                getData();
                                Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();

                            }

                        });
//                        finish();

                    }else {
                        getActivity().runOnUiThread(new Runnable() {

                            @Override
                            public void run() {
                                //更新UI
                                Toast.makeText(getActivity(), "保存失败"+object.optString("msg"), Toast.LENGTH_SHORT).show();

                            }

                        });

                    }
                    str = "";
                }catch (Exception ex)
                {
                    ex.printStackTrace();
                    getActivity().runOnUiThread(new Runnable() {

                        @Override
                        public void run() {
                            //更新UI
                            Toast.makeText(getActivity(), "保存失败", Toast.LENGTH_SHORT).show();

                        }

                    });
                }
            }
        });
    }

    /**
     * adapter
     */
    class DemoAdapter extends BaseQuickAdapter<ZQUserDetailBaseInfo, BaseViewHolder> {
        int mLayoutId;
        public DemoAdapter(Context context, int LayoutId, List<ZQUserDetailBaseInfo> info) {
            super( LayoutId, info);
            mLayoutId = LayoutId;
        }

        @Override
        public void convert(BaseViewHolder helper, ZQUserDetailBaseInfo info) {
            helper.setGone(R.id.btn_commit,false);
            helper.setGone(R.id.base_2,false);



            helper.setVisible(R.id.ll_change_how,true);
            if(info == null)
            {
                return;
            }


//            helper.setVisible(R.id.tv_editname1,true);
//            helper.setVisible(R.id.tv_editname2,true);
//            helper.setVisible(R.id.tv_editname3,true);
//            helper.setVisible(R.id.tv_editname4,true);
//            helper.setVisible(R.id.tv_editname5,true);
//            helper.setVisible(R.id.tv_editname6,true);
//            helper.setVisible(R.id.tv_change_legalname1,true);

            helper.addOnClickListener(R.id.tv_editname1);
            helper.addOnClickListener(R.id.tv_editname2);
            helper.addOnClickListener(R.id.tv_editname3);
            helper.addOnClickListener(R.id.tv_editname4);
            helper.addOnClickListener(R.id.tv_editname5);
            helper.addOnClickListener(R.id.tv_editname6);
            helper.addOnClickListener(R.id.tv_change_legalname1);
            helper.addOnClickListener(R.id.tv_person_base_pyname_py_4);
            helper.addOnClickListener(R.id.tv_person_base_pyname_py_5);

            helper.addOnClickListener(R.id.tv_change_proxy_legalname1);
            helper.addOnClickListener(R.id.tv_change_proxyname1);
//            helper.setVisible(R.id.activity_show_zq_show,true);


//            if(info.getIdentityStatus()==null )
//            {
//
//            }

            if(info.getIdentityStatus()!=null && "0".equalsIgnoreCase(info.getIdentityStatus().getValue()))
            {
                helper.setVisible(R.id.btn_commit,true);
                helper.addOnClickListener(R.id.btn_commit);
            }
            helper.setGone(R.id.group_userbase_show, false);
            helper.setGone(R.id.group_user_proxyer_base_show, false);



            if (info != null && (info.getIdentityBigTypes() == null))
            {
                helper.setVisible(R.id.base_2,true);
                helper.setText(R.id.tv_zq_name,info.getCreditorName());
                helper.setVisible(R.id.tv_editname1, false);
                helper.setVisible(R.id.tv_editname2, false);
                helper.setVisible(R.id.tv_editname3, false);
                helper.setVisible(R.id.tv_editname4, false);
                helper.setVisible(R.id.tv_editname5, false);
                helper.setVisible(R.id.tv_editname6, false);
                helper.setVisible(R.id.tv_change_legalname1, false);


                if(info.getContact() == null || "".equalsIgnoreCase(info.getContact()) )
                {


                    helper.setText(R.id.tv_zq_phone,"——");
                    helper.setVisible(R.id.tv_zq_phone_add,true);
                    helper.addOnClickListener(R.id.tv_zq_phone_add);
                    helper.setVisible(R.id.tv_zq_setuser, true);
                    helper.addOnClickListener(R.id.tv_zq_setuser);
                    helper.setVisible(R.id.tv_zq_phone_notice,true);
                }else{
                    helper.setText(R.id.tv_zq_phone,info.getContact());
                    helper.setVisible(R.id.tv_zq_phone_add,false);
                    helper.setVisible(R.id.tv_zq_phone_notice,false);
                    if ("true".equalsIgnoreCase(info.getIsVirtualAccount())) {
                        helper.setVisible(R.id.tv_zq_setuser_notice, true);
                    } else {
                        helper.setVisible(R.id.tv_zq_setuser_notice, false);
                    }
                }



            }
            if ("0".equalsIgnoreCase(info.getIdentityBigTypes().getValue()) && "0".equalsIgnoreCase(info.getIdentitySmallTypes().getValue()))
            {
                helper.setGone(R.id.base_2, false);
                helper.setGone(R.id.group_userbase_show, true);

                if (!"0".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"1".equalsIgnoreCase(info.getProcessStatus().getValue())
                        && !"3".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"4".equalsIgnoreCase(info.getProcessStatus().getValue())
                ) {

//                    if( info.getAuth()!=null) {
//                        if (info.getAuth().isChangeOfCreditorName()) {
//                            helper.setVisible(R.id.tv_editname2, true);
//                        }
//                        if (info.getAuth().isChangeOfLegalRepresentative()) {
//                            helper.setVisible(R.id.tv_change_legalname1, false);
//                        }
//                    }
                }
                helper.setText(R.id.zq_group_base_name,  Utils.tmpString(info.getCreditorName()));
                helper.setText(R.id.group_base_social,  Utils.tmpString(info.getSocialUniformCreditCode()));
                helper.setText(R.id.group_base_legalname,  Utils.tmpString(info.getLegalRepresentativeName()));
                helper.setText(R.id.group_legal_phone,  Utils.tmpString(info.getContact()));
                helper.setText(R.id.group_legal_other_phone, Utils.tmpString(info.getOtherContact()) );
                helper.setText(R.id.group_legal_other_email,  Utils.tmpString(info.getEmail()));
                helper.setText(R.id.group_base_bankinfo1, "账户名：" +  Utils.tmpString(info.getBankAccountName()));
                helper.setText(R.id.group_base_bankinfo2, "开户行：" +  Utils.tmpString(info.getBank()));
                helper.setText(R.id.group_base_bankinfo3, "账号：" +  Utils.tmpString(info.getBankAccount()));

                helper.setText(R.id.group_legal_cardnum, hideMidText( Utils.tmpString(info.getCardNumber())));
                final ImageView img_group_legal_cardnum = (ImageView) helper.getView(R.id.img_group_legal_cardnum);

                final TextView group_legal_cardnum = (TextView) helper.getView(R.id.group_legal_cardnum);
                final String strCardNumber = info.getCardNumber();
                img_group_legal_cardnum.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (group_legal_cardnum.getText().toString().indexOf("*") == -1) {
                            group_legal_cardnum.setText(hideMidText(strCardNumber));
                            img_group_legal_cardnum.setImageResource(R.drawable.icon_visible);
                        } else {
                            group_legal_cardnum.setText(strCardNumber);
                            img_group_legal_cardnum.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });

                final ImageView group_legal_other_email_click = (ImageView) helper.getView(R.id.group_legal_other_email_click);
                final String strEmail = info.getEmail();
                group_legal_other_email_click.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (!"".equalsIgnoreCase(strEmail)) {
                            Intent data = new Intent(Intent.ACTION_SENDTO);
                            data.setData(Uri.parse("mailto:" + strEmail));
                            data.putExtra(Intent.EXTRA_SUBJECT, "");
                            data.putExtra(Intent.EXTRA_TEXT, "");
                            startActivity(data);
                        }
                    }
                });


                if (info.getAddressInfo() != null) {
                    helper.setText(R.id.group_legal_addr, Utils.tmpString(info.getAddressInfo().getDetailString()));
                }else{
                    helper.setText(R.id.group_legal_addr,  Utils.tmpString(""));
                }




                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.group_userbase_recycler1);
                mImgRecyclerView1.setNestedScrollingEnabled(false);

                mImgAdapter1 = new FileAdapter(getActivity(), mImgList1);
                mImgRecyclerView1.setLayoutManager(mImgAdapter1.createLayoutManager());
                mImgRecyclerView1.setAdapter(mImgAdapter1);
                mImgList1.clear();

                if (info.getProvideBusinessLicenseAttas() != null) {
                    mImgList1.addAll(info.getProvideBusinessLicenseAttas());

                }

                if("1".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler1_txt,  true);
                    helper.setText(R.id.group_userbase_recycler1_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_recycler1,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler1_txt,  true);
                    helper.setText(R.id.group_userbase_recycler1_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_recycler1,  false);
                }else{
                    helper.setGone(R.id.group_userbase_recycler1_txt,  false);
                    helper.setVisible(R.id.group_userbase_recycler1,  true);
                }


                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.group_userbase_recycler2);
                mImgRecyclerView2.setNestedScrollingEnabled(false);

                mImgAdapter2 = new FileAdapter(getActivity(), mImgList2);
                mImgRecyclerView2.setLayoutManager(mImgAdapter2.createLayoutManager());
                mImgRecyclerView2.setAdapter(mImgAdapter2);
                mImgList2.clear();

                if (info.getProvideCardAttas() != null) {
                    mImgList2.addAll(info.getProvideCardAttas());

                }



//                    mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.group_userbase_recycler2);
//                    mImgRecyclerView2.setNestedScrollingEnabled(false);
//
//
//                    FullyGridLayoutManager manager2 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView2.setLayoutManager(manager2);
//                    mImgAdapter2 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList2.clear();
//                    mImgAdapter2.setList(mImgList2);
//                    mImgRecyclerView2.setAdapter(mImgAdapter2);
//
//                    if (info.getProvideCardAttas() != null) {
//                        for (int i = 0; i < info.getProvideCardAttas().size(); i++) {
//                            TaskAtta atta = info.getProvideCardAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList2.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                                BaseCreateActivity.sorFiles(mImgList2, true);
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }

                if("1".equalsIgnoreCase(info.getProvideCard().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler2_txt,  true);
                    helper.setText(R.id.group_userbase_recycler2_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_recycler2,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler2_txt,  true);
                    helper.setText(R.id.group_userbase_recycler2_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_recycler2,  false);
                }else{
                    helper.setGone(R.id.group_userbase_recycler2_txt,  false);
                    helper.setVisible(R.id.group_userbase_recycler2,  true);
                }

                mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.group_userbase_recycler3);
                mImgRecyclerView3.setNestedScrollingEnabled(false);

                mImgAdapter3 = new FileAdapter(getActivity(), mImgList3);
                mImgRecyclerView3.setLayoutManager(mImgAdapter3.createLayoutManager());
                mImgRecyclerView3.setAdapter(mImgAdapter3);
                mImgList3.clear();

                if (info.getProvideLegalRepresentativeAttas() != null) {
                    mImgList3.addAll(info.getProvideLegalRepresentativeAttas());

                }

//                    mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.group_userbase_recycler3);
//                    mImgRecyclerView3.setNestedScrollingEnabled(false);
//
//
//                    FullyGridLayoutManager manager3 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView3.setLayoutManager(manager3);
//                    mImgAdapter3 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList3.clear();
//                    mImgAdapter3.setList(mImgList3);
//                    mImgRecyclerView3.setAdapter(mImgAdapter3);
//
//                    if (info.getProvideLegalRepresentativeAttas() != null) {
//                        for (int i = 0; i < info.getProvideLegalRepresentativeAttas().size(); i++) {
//                            TaskAtta atta = info.getProvideLegalRepresentativeAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList3.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                                BaseCreateActivity.sorFiles(mImgList3, true);
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }

                if("1".equalsIgnoreCase(info.getProvideLegalRepresentative().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler3_txt,  true);
                    helper.setText(R.id.group_userbase_recycler3_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_recycler3,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler3_txt,  true);
                    helper.setText(R.id.group_userbase_recycler3_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_recycler3,  false);
                }else{
                    helper.setGone(R.id.group_userbase_recycler3_txt,  false);
                    helper.setVisible(R.id.group_userbase_recycler3,  true);
                }

            } else if ("0".equalsIgnoreCase(info.getIdentityBigTypes().getValue()) && "1".equalsIgnoreCase(info.getIdentitySmallTypes().getValue()))
            {
                helper.setGone(R.id.base_2, false);
                helper.setGone(R.id.group_userbase_show, false);
                helper.setGone(R.id.group_user_proxyer_base_show, true);

                if (!"0".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"1".equalsIgnoreCase(info.getProcessStatus().getValue())
                        && !"3".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"4".equalsIgnoreCase(info.getProcessStatus().getValue())) {
//                    if( info.getAuth()!=null) {
//                        if (info.getAuth().isChangeOfCreditorName()) {
//                            helper.setVisible(R.id.tv_editname3, true);
//                        }
//                        if (info.getAuth().isChangeOfLegalRepresentative()) {
//                            helper.setVisible(R.id.tv_change_proxy_legalname1, true);
//                        }
//                        if (info.getAuth().isChangeOfAgent()) {
//                            helper.setVisible(R.id.tv_change_proxyname1, true);
//                        }
//                    }

                }

                helper.setText(R.id.zq_group_base_name_py,  Utils.tmpString(info.getCreditorName()));
                helper.setText(R.id.tv_zqr_base_jg_social,  Utils.tmpString(info.getSocialUniformCreditCode()));
                helper.setText(R.id.tv_zqr_base_legalname,  Utils.tmpString(info.getLegalRepresentativeName()));
//                helper.setText(R.id.group_base_social_py,);
                helper.setText(R.id.group_base_legalname_py,  Utils.tmpString(info.getAgentName()));
                helper.setText(R.id.group_legal_phone_py,  Utils.tmpString(info.getContact()));
                helper.setText(R.id.group_legal_other_phone_py,  Utils.tmpString(info.getOtherContact()));
                helper.setText(R.id.group_legal_other_email_py,  Utils.tmpString(info.getEmail()));

                final ImageView group_legal_other_email_py_click = (ImageView) helper.getView(R.id.group_legal_other_email_py_click);
                final String strEmail = info.getEmail();
                group_legal_other_email_py_click.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (!"".equalsIgnoreCase(strEmail)) {
                            Intent data = new Intent(Intent.ACTION_SENDTO);
                            data.setData(Uri.parse("mailto:" + strEmail));
                            data.putExtra(Intent.EXTRA_SUBJECT, "");
                            data.putExtra(Intent.EXTRA_TEXT, "");
                            startActivity(data);
                        }
                    }
                });


                helper.setText(R.id.group_base_bankinfo1_py, "账户名：" + Utils.tmpString(info.getBankAccountName()));
                helper.setText(R.id.group_base_bankinfo2_py, "开户行：" + Utils.tmpString(info.getBank()));
                helper.setText(R.id.group_base_bankinfo3_py, "账号：" + Utils.tmpString(info.getBankAccount()));

                helper.setText(R.id.group_legal_cardnum_py, Utils.tmpString(info.getAgentLicenseNumber()));

                helper.setText(R.id.group_legal_cardnum_py, hideMidText(info.getCreditorsIDCardNumber()));
                final ImageView img_group_legal_cardnum_py = (ImageView) helper.getView(R.id.img_group_legal_cardnum_py);

                final TextView group_legal_cardnum = (TextView) helper.getView(R.id.group_legal_cardnum_py);
                final String strAgentLicenseNumber = info.getAgentLicenseNumber();
                img_group_legal_cardnum_py.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (group_legal_cardnum.getText().toString().indexOf("*") == -1) {
                            group_legal_cardnum.setText(hideMidText(strAgentLicenseNumber));
                            img_group_legal_cardnum_py.setImageResource(R.drawable.icon_visible);
                        } else {
                            group_legal_cardnum.setText(strAgentLicenseNumber);
                            img_group_legal_cardnum_py.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });


                if (info.getAddressInfo() != null) {
                    helper.setText(R.id.group_legal_addr_py, Utils.tmpString(info.getAddressInfo().getDetailString()));
                }else{
                    helper.setText(R.id.group_legal_addr_py, Utils.tmpString(""));
                }

                mImgRecyclerView4 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler4);
                mImgRecyclerView4.setNestedScrollingEnabled(false);

                mImgAdapter4 = new FileAdapter(getActivity(), mImgList4);
                mImgRecyclerView4.setLayoutManager(mImgAdapter4.createLayoutManager());
                mImgRecyclerView4.setAdapter(mImgAdapter4);
                mImgList4.clear();

                if (info.getProvideLegalRepresentativeAttas() != null) {
                    mImgList4.addAll(info.getProvideLegalRepresentativeAttas());

                }

//                    mImgRecyclerView4 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler4);
//                    mImgRecyclerView4.setNestedScrollingEnabled(false);
//
//
//                    FullyGridLayoutManager manager4 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView4.setLayoutManager(manager4);
//                    mImgAdapter4 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList4.clear();
//                    mImgAdapter4.setList(mImgList4);
//                    mImgRecyclerView4.setAdapter(mImgAdapter4);
//
//                    if (info.getProvideLegalRepresentativeAttas() != null) {
//                        for (int i = 0; i < info.getProvideLegalRepresentativeAttas().size(); i++) {
//                            TaskAtta atta = info.getProvideLegalRepresentativeAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList4.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                                BaseCreateActivity.sorFiles(mImgList4, true);
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }
                if("1".equalsIgnoreCase(info.getProvideLegalRepresentative().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler4_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler4_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler4,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler4_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler4_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler4,  false);
                }else{
                    helper.setGone(R.id.group_userbase_proxy_recycler4_txt,  false);
                    helper.setVisible(R.id.group_userbase_proxy_recycler4,  true);
                }


                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler1);
                mImgRecyclerView1.setNestedScrollingEnabled(false);

                mImgAdapter1 = new FileAdapter(getActivity(), mImgList1);
                mImgRecyclerView1.setLayoutManager(mImgAdapter1.createLayoutManager());
                mImgRecyclerView1.setAdapter(mImgAdapter1);
                mImgList1.clear();

                if (info.getProvideBusinessLicenseAttas() != null) {
                    mImgList1.addAll(info.getProvideBusinessLicenseAttas());

                }

//                    mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler1);
//                    mImgRecyclerView1.setNestedScrollingEnabled(false);
//
//                    FullyGridLayoutManager manager = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView1.setLayoutManager(manager);
//                    mImgAdapter1 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList1.clear();
//                    mImgAdapter1.setList(mImgList1);
//                    mImgRecyclerView1.setAdapter(mImgAdapter1);
//
//                    if (info.getProvideBusinessLicenseAttas() != null) {
//                        for (int i = 0; i < info.getProvideBusinessLicenseAttas().size(); i++) {
//                            TaskAtta atta = info.getProvideBusinessLicenseAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList1.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                                BaseCreateActivity.sorFiles(mImgList1, true);
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }
                if("1".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler1_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler1,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler1_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler1,  false);
                }else{
                    helper.setGone(R.id.group_userbase_proxy_recycler1_txt,  false);
                    helper.setVisible(R.id.group_userbase_proxy_recycler1,  true);
                }

                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler2);
                mImgRecyclerView2.setNestedScrollingEnabled(false);

                mImgAdapter2 = new FileAdapter(getActivity(), mImgList2);
                mImgRecyclerView2.setLayoutManager(mImgAdapter2.createLayoutManager());
                mImgRecyclerView2.setAdapter(mImgAdapter2);
                mImgList2.clear();

                if (info.getCreditorsProvideCardAttas() != null) {
                    mImgList2.addAll(info.getCreditorsProvideCardAttas());

                }

//                    mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler2);
//                    mImgRecyclerView2.setNestedScrollingEnabled(false);
//
//
//                    FullyGridLayoutManager manager2 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView2.setLayoutManager(manager2);
//                    mImgAdapter2 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList2.clear();
//                    mImgAdapter2.setList(mImgList2);
//                    mImgRecyclerView2.setAdapter(mImgAdapter2);
//
//                    if (info.getCreditorsProvideCardAttas() != null) {
//                        for (int i = 0; i < info.getCreditorsProvideCardAttas().size(); i++) {
//                            TaskAtta atta = info.getCreditorsProvideCardAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList2.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                                BaseCreateActivity.sorFiles(mImgList2, true);
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }

                if("1".equalsIgnoreCase(info.getCreditorsProvideCard().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler2_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler2,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler2_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler2,  false);
                }else{
                    helper.setGone(R.id.group_userbase_proxy_recycler2_txt,  false);
                    helper.setVisible(R.id.group_userbase_proxy_recycler2,  true);
                }

                mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler3);
                mImgRecyclerView3.setNestedScrollingEnabled(false);

                mImgAdapter3 = new FileAdapter(getActivity(), mImgList3);
                mImgRecyclerView3.setLayoutManager(mImgAdapter3.createLayoutManager());
                mImgRecyclerView3.setAdapter(mImgAdapter3);
                mImgList3.clear();

                if (info.getProvidePowerAttorneyAttas() != null) {
                    mImgList3.addAll(info.getProvidePowerAttorneyAttas());

                }


//                    mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler3);
//                    mImgRecyclerView3.setNestedScrollingEnabled(false);
//
//
//                    FullyGridLayoutManager manager3 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView3.setLayoutManager(manager3);
//                    mImgAdapter3 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList3.clear();
//                    mImgAdapter3.setList(mImgList3);
//                    mImgRecyclerView3.setAdapter(mImgAdapter3);
//
//                    if (info.getProvidePowerAttorneyAttas() != null) {
//                        for (int i = 0; i < info.getProvidePowerAttorneyAttas().size(); i++) {
//                            TaskAtta atta = info.getProvidePowerAttorneyAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList3.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                                BaseCreateActivity.sorFiles(mImgList3, true);
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }

                if("1".equalsIgnoreCase(info.getProvidePowerAttorney().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler3_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler3_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler3,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler3_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler3_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler3,  false);
                }else{
                    helper.setGone(R.id.group_userbase_proxy_recycler3_txt,  false);
                    helper.setVisible(R.id.group_userbase_proxy_recycler3,  true);
                }

            } else if ("1".equalsIgnoreCase(info.getIdentityBigTypes().getValue()) && "2".equalsIgnoreCase(info.getIdentitySmallTypes().getValue()))
            {
                helper.setGone(R.id.base_2, false);
                helper.setGone(R.id.zqbase_personbase_show, true);

                helper.setText(R.id.zq_person_base_name, Utils.tmpString(info.getCreditorName()));
                helper.setText(R.id.person_legal_phone, Utils.tmpString(info.getContact()));
                helper.setText(R.id.person_legal_other_phone, Utils.tmpString(info.getOtherContact()));
                helper.setText(R.id.person_legal_other_email, Utils.tmpString(info.getEmail()));
                final ImageView person_legal_other_email_click = (ImageView) helper.getView(R.id.person_legal_other_email_click);
                final String strEmail = info.getEmail();
                person_legal_other_email_click.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (!"".equalsIgnoreCase(strEmail)) {
                            Intent data = new Intent(Intent.ACTION_SENDTO);
                            data.setData(Uri.parse("mailto:" + strEmail));
                            data.putExtra(Intent.EXTRA_SUBJECT, "");
                            data.putExtra(Intent.EXTRA_TEXT, "");
                            startActivity(data);
                        }
                    }
                });


                helper.setText(R.id.person_base_bankinfo1, "账户名：" +  Utils.tmpString(info.getBankAccountName()));
                helper.setText(R.id.person_base_bankinfo2, "开户行：" +  Utils.tmpString(info.getBank()));
                helper.setText(R.id.person_base_bankinfo3, "账号：" +  Utils.tmpString(info.getBankAccount()));
                helper.setText(R.id.person_legal_cardnum, hideMidText(info.getCardNumber()));
                if (info.getAddressInfo() != null)
                {
                    helper.setText(R.id.person_legal_addr,  Utils.tmpString(info.getAddressInfo().getDetailString()));
                }else{
                    helper.setText(R.id.person_legal_addr,  Utils.tmpString(""));
                }

//                helper.setText(R.id.group_legal_cardnum,hideMidText(info.getCardNumber()));
                final ImageView img_person_legal_cardnum = (ImageView) helper.getView(R.id.img_person_legal_cardnum);

                final TextView person_legal_cardnum = (TextView) helper.getView(R.id.person_legal_cardnum);
                final String strCardNumber = info.getCardNumber();
                img_person_legal_cardnum.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (person_legal_cardnum.getText().toString().indexOf("*") == -1) {
                            person_legal_cardnum.setText(hideMidText(strCardNumber));
                            img_person_legal_cardnum.setImageResource(R.drawable.icon_visible);
                        } else {
                            person_legal_cardnum.setText(strCardNumber);
                            img_person_legal_cardnum.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });


                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler1);
                mImgRecyclerView1.setNestedScrollingEnabled(false);

                mImgAdapter1 = new FileAdapter(getActivity(), mImgList1);
                mImgRecyclerView1.setLayoutManager(mImgAdapter1.createLayoutManager());
                mImgRecyclerView1.setAdapter(mImgAdapter1);
                mImgList1.clear();

                if (info.getProvideCardAttas() != null) {
                    mImgList1.addAll(info.getProvideCardAttas());

                }

//                    mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler1);
//                    mImgRecyclerView1.setNestedScrollingEnabled(false);
//
//                    FullyGridLayoutManager manager = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView1.setLayoutManager(manager);
//                    mImgAdapter1 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList1.clear();
//                    mImgAdapter1.setList(mImgList1);
//                    mImgRecyclerView1.setAdapter(mImgAdapter1);
//
//                    if (info.getProvideCardAttas() != null) {
//                        for (int i = 0; i < info.getProvideCardAttas().size(); i++) {
//                            TaskAtta atta = info.getProvideCardAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList1.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                                BaseCreateActivity.sorFiles(mImgList1, true);
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }

                if("1".equalsIgnoreCase(info.getProvideCard().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler1_txt,  "线下提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler1,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler1_txt,  "已提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler1,  false);
                }else{
                    helper.setGone(R.id.person_userbase_proxy_recycler1_txt,  false);
                    helper.setVisible(R.id.person_userbase_proxy_recycler1,  true);
                }
//                    helper.setGone(R.id.person_userbase_proxy_recycler1,  false);

            } else if ("1".equalsIgnoreCase(info.getIdentityBigTypes().getValue()) && "1".equalsIgnoreCase(info.getIdentitySmallTypes().getValue()))
            {
                helper.setGone(R.id.base_2, false);
                helper.setGone(R.id.activity_edit_zqbase_person_userbase_proxyer_show, true);


                if (!"0".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"1".equalsIgnoreCase(info.getProcessStatus().getValue())
                        && !"3".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"4".equalsIgnoreCase(info.getProcessStatus().getValue())) {

//                    if( info.getAuth()!=null) {
//                        if (info.getAuth().isChangeOfAgent()) {
//                            helper.setVisible(R.id.tv_person_base_pyname_py_4, true);
//                        }
//                    }
//                        helper.setVisible(R.id.tv_person_base_pyname_py_4, true);
                }


                helper.setText(R.id.zq_person_base_name_py,  Utils.tmpString(info.getCreditorName()));

                helper.setText(R.id.zq_person_base_pyname_py,  Utils.tmpString(info.getAgentName()));
                helper.setText(R.id.person_legal_phone_py,  Utils.tmpString(info.getContact()));
                helper.setText(R.id.person_legal_other_phone_py,  Utils.tmpString(info.getOtherContact()));
                helper.setText(R.id.person_legal_other_email_py,  Utils.tmpString(info.getEmail()));

                final ImageView person_legal_other_email_py_click = (ImageView) helper.getView(R.id.person_legal_other_email_py_click);
                final String strEmail = info.getEmail();
                person_legal_other_email_py_click.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (!"".equalsIgnoreCase(strEmail)) {
                            Intent data = new Intent(Intent.ACTION_SENDTO);
                            data.setData(Uri.parse("mailto:" + strEmail));
                            data.putExtra(Intent.EXTRA_SUBJECT, "");
                            data.putExtra(Intent.EXTRA_TEXT, "");
                            startActivity(data);
                        }
                    }
                });


                helper.setText(R.id.person_base_bankinfo1_py, "账户名：" +  Utils.tmpString(info.getBankAccountName()));
                helper.setText(R.id.person_base_bankinfo2_py, "开户行：" +  Utils.tmpString(info.getBank()));
                helper.setText(R.id.person_base_bankinfo3_py, "账号：" +  Utils.tmpString(info.getBankAccount()));
                helper.setText(R.id.person_legal_cardnum_py, hideMidText( Utils.tmpString(info.getCreditorsIDCardNumber())));
                helper.setText(R.id.person_legal_cardnum_cr_py, hideMidText( Utils.tmpString(info.getCardNumber())));


                final ImageView img_person_legal_cardnum_py = (ImageView) helper.getView(R.id.img_person_legal_cardnum_py);

                final TextView person_legal_cardnum_py = (TextView) helper.getView(R.id.person_legal_cardnum_py);
                final String strCardNumber = info.getCreditorsIDCardNumber();
                img_person_legal_cardnum_py.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (person_legal_cardnum_py.getText().toString().indexOf("*") == -1) {
                            person_legal_cardnum_py.setText(hideMidText(strCardNumber));
                            img_person_legal_cardnum_py.setImageResource(R.drawable.icon_visible);
                        } else {
                            person_legal_cardnum_py.setText(strCardNumber);
                            img_person_legal_cardnum_py.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });


                final ImageView img_person_legal_cardnum_cr_py = (ImageView) helper.getView(R.id.img_person_legal_cardnum_cr_py);

                final TextView person_legal_cardnum_cr_py = (TextView) helper.getView(R.id.person_legal_cardnum_cr_py);
                final String strCrCardNumber = info.getCardNumber();
                img_person_legal_cardnum_cr_py.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (person_legal_cardnum_cr_py.getText().toString().indexOf("*") == -1) {
                            person_legal_cardnum_cr_py.setText(hideMidText(strCrCardNumber));
                            img_person_legal_cardnum_cr_py.setImageResource(R.drawable.icon_visible);
                        } else {
                            person_legal_cardnum_cr_py.setText(strCrCardNumber);
                            img_person_legal_cardnum_cr_py.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });


                if (info.getAddressInfo() != null) {
                    helper.setText(R.id.person_legal_addr_py, Utils.tmpString(info.getAddressInfo().getDetailString()));
                }else{
                    helper.setText(R.id.person_legal_addr_py, Utils.tmpString(""));
                }

                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_py_recycler1);
                mImgRecyclerView1.setNestedScrollingEnabled(false);

                mImgAdapter1 = new FileAdapter(getActivity(), mImgList1);
                mImgRecyclerView1.setLayoutManager(mImgAdapter1.createLayoutManager());
                mImgRecyclerView1.setAdapter(mImgAdapter1);
                mImgList1.clear();

                if (info.getProvideCardAttas() != null) {
                    mImgList1.addAll(info.getProvideCardAttas());

                }
//                    mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_py_recycler1);
//                    mImgRecyclerView1.setNestedScrollingEnabled(false);
//
//                    FullyGridLayoutManager manager = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView1.setLayoutManager(manager);
//                    mImgAdapter1 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList1.clear();
//                    mImgAdapter1.setList(mImgList1);
//                    mImgRecyclerView1.setAdapter(mImgAdapter1);
//
//
//                    if (info.getProvideCardAttas() != null) {
//                        for (int i = 0; i < info.getProvideCardAttas().size(); i++) {
//                            TaskAtta atta = info.getProvideCardAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList1.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }

                if("1".equalsIgnoreCase(info.getProvideCard().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_py_recycler1_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_py_recycler1_txt,  "线下提供");
                    helper.setGone(R.id.person_userbase_proxy_py_recycler1,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_py_recycler1_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_py_recycler1_txt,  "已提供");
                    helper.setGone(R.id.person_userbase_proxy_py_recycler1,  false);
                }else{
                    helper.setGone(R.id.person_userbase_proxy_py_recycler1_txt,  false);
                    helper.setVisible(R.id.person_userbase_proxy_py_recycler1,  true);
                }


                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler2);
                mImgRecyclerView2.setNestedScrollingEnabled(false);

                mImgAdapter2 = new FileAdapter(getActivity(), mImgList2);
                mImgRecyclerView2.setLayoutManager(mImgAdapter2.createLayoutManager());
                mImgRecyclerView2.setAdapter(mImgAdapter2);
                mImgList2.clear();

                if (info.getCreditorsProvideCardAttas() != null) {
                    mImgList2.addAll(info.getCreditorsProvideCardAttas());

                }
//                    mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler2);
//                    mImgRecyclerView2.setNestedScrollingEnabled(false);
//
//
//                    FullyGridLayoutManager manager2 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView2.setLayoutManager(manager2);
//                    mImgAdapter2 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList2.clear();
//                    mImgAdapter2.setList(mImgList2);
//                    mImgRecyclerView2.setAdapter(mImgAdapter2);
//
//                    if (info.getCreditorsProvideCardAttas() != null) {
//                        for (int i = 0; i < info.getCreditorsProvideCardAttas().size(); i++) {
//                            TaskAtta atta = info.getCreditorsProvideCardAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList2.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                                BaseCreateActivity.sorFiles(mImgList2, true);
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }

                if("1".equalsIgnoreCase(info.getCreditorsProvideCard().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler2_txt,  "线下提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler2,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler2_txt,  "已提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler2,  false);
                }else{
                    helper.setGone(R.id.person_userbase_proxy_recycler2_txt,  false);
                    helper.setVisible(R.id.person_userbase_proxy_recycler2,  true);
                }

                mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler3);
                mImgRecyclerView3.setNestedScrollingEnabled(false);

                mImgAdapter3 = new FileAdapter(getActivity(), mImgList3);
                mImgRecyclerView3.setLayoutManager(mImgAdapter3.createLayoutManager());
                mImgRecyclerView3.setAdapter(mImgAdapter3);
                mImgList3.clear();

                if (info.getProvidePowerAttorneyAttas() != null) {
                    mImgList3.addAll(info.getProvidePowerAttorneyAttas());

                }

//                    mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler3);
//                    mImgRecyclerView3.setNestedScrollingEnabled(false);
//
//
//                    FullyGridLayoutManager manager3 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView3.setLayoutManager(manager3);
//                    mImgAdapter3 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList3.clear();
//                    mImgAdapter3.setList(mImgList3);
//                    mImgRecyclerView3.setAdapter(mImgAdapter3);
//
//                    if (info.getProvidePowerAttorneyAttas() != null) {
//                        for (int i = 0; i < info.getProvidePowerAttorneyAttas().size(); i++) {
//                            TaskAtta atta = info.getProvidePowerAttorneyAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList3.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                                BaseCreateActivity.sorFiles(mImgList3, true);
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }

                if("1".equalsIgnoreCase(info.getProvidePowerAttorney().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler3_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler3_txt,  "线下提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler3,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler3_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler3_txt,  "已提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler3,  false);
                }else{
                    helper.setGone(R.id.person_userbase_proxy_recycler3_txt,  false);
                    helper.setVisible(R.id.person_userbase_proxy_recycler3,  true);
                }


            } else if ("2".equalsIgnoreCase(info.getIdentityBigTypes().getValue()))
            {
                helper.setGone(R.id.base_2, false);
                helper.setGone(R.id.activity_edit_zqbase_tax_userbase_proxyer_show, true);
                if (!"0".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"1".equalsIgnoreCase(info.getProcessStatus().getValue())
                        && !"3".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"4".equalsIgnoreCase(info.getProcessStatus().getValue())) {

//                    if( info.getAuth()!=null) {
//                        if (info.getAuth().isChangeOfAgent()) {
//                            helper.setVisible(R.id.tv_person_base_pyname_py_5, true);
//                        }
//                    }
//                        helper.setVisible(R.id.tv_person_base_pyname_py_5, true);
                }
                helper.setText(R.id.zq_tax_base_name_py, Utils.tmpString(info.getCreditorName()));
                helper.setText(R.id.zq_tax_base_pyname_py, Utils.tmpString(info.getAgentName()));
                helper.setText(R.id.tax_legal_phone_py, Utils.tmpString(info.getContact()));
                helper.setText(R.id.tax_legal_other_phone_py, Utils.tmpString(info.getOtherContact()));
                helper.setText(R.id.tax_legal_other_email_py, Utils.tmpString(info.getEmail()));

                final ImageView tax_legal_other_email_py_click = (ImageView) helper.getView(R.id.tax_legal_other_email_py_click);
                final String strEmail = Utils.tmpString(info.getEmail());
                tax_legal_other_email_py_click.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (!"".equalsIgnoreCase(strEmail)) {
                            Intent data = new Intent(Intent.ACTION_SENDTO);
                            data.setData(Uri.parse("mailto:" + strEmail));
                            data.putExtra(Intent.EXTRA_SUBJECT, "");
                            data.putExtra(Intent.EXTRA_TEXT, "");
                            startActivity(data);
                        }
                    }
                });

                helper.setText(R.id.tax_base_bankinfo1_py, "账户名：" + Utils.tmpString(info.getBankAccountName()));
                helper.setText(R.id.tax_base_bankinfo2_py, "开户行：" + Utils.tmpString(info.getBank()));
                helper.setText(R.id.tax_base_bankinfo3_py, "账号：" + Utils.tmpString(info.getBankAccount()));
                helper.setText(R.id.tax_legal_cardnum_py, hideMidText(Utils.tmpString(info.getCreditorsIDCardNumber())));
                if (info.getAddressInfo() != null) {
                    helper.setText(R.id.tax_legal_addr_py, Utils.tmpString(info.getAddressInfo().getDetailString()));
                }else{
                    helper.setText(R.id.tax_legal_addr_py, Utils.tmpString(""));
                }


                final ImageView img_tax_legal_cardnum_py = (ImageView) helper.getView(R.id.img_tax_legal_cardnum_py);

                final TextView tax_legal_cardnum_py = (TextView) helper.getView(R.id.tax_legal_cardnum_py);
                final String strCardNumber = info.getCreditorsIDCardNumber();
                img_tax_legal_cardnum_py.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (tax_legal_cardnum_py.getText().toString().indexOf("*") == -1) {
                            tax_legal_cardnum_py.setText(hideMidText(strCardNumber));
                            img_tax_legal_cardnum_py.setImageResource(R.drawable.icon_visible);
                        } else {
                            tax_legal_cardnum_py.setText(strCardNumber);
                            img_tax_legal_cardnum_py.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });

                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.tax_userbase_proxy_recycler1);
                mImgRecyclerView1.setNestedScrollingEnabled(false);

                mImgAdapter1 = new FileAdapter(getActivity(), mImgList1);
                mImgRecyclerView1.setLayoutManager(mImgAdapter1.createLayoutManager());
                mImgRecyclerView1.setAdapter(mImgAdapter1);
                mImgList1.clear();

                if (info.getCreditorsProvideCardAttas() != null) {
                    mImgList1.addAll(info.getCreditorsProvideCardAttas());

                }
//                    mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.tax_userbase_proxy_recycler1);
//                    mImgRecyclerView1.setNestedScrollingEnabled(false);
//
//                    FullyGridLayoutManager manager = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView1.setLayoutManager(manager);
//                    mImgAdapter1 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList1.clear();
//                    mImgAdapter1.setList(mImgList1);
//                    mImgRecyclerView1.setAdapter(mImgAdapter1);
//
//                    if (info.getCreditorsProvideCardAttas() != null) {
//                        for (int i = 0; i < info.getCreditorsProvideCardAttas().size(); i++) {
//                            TaskAtta atta = info.getCreditorsProvideCardAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList1.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                                BaseCreateActivity.sorFiles(mImgList1, true);
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }

                if("1".equalsIgnoreCase(info.getCreditorsProvideCard().getValue()))
                {
                    helper.setVisible(R.id.tax_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.tax_userbase_proxy_recycler1_txt,  "线下提供");
                    helper.setGone(R.id.tax_userbase_proxy_recycler1,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.tax_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.tax_userbase_proxy_recycler1_txt,  "已提供");
                    helper.setGone(R.id.tax_userbase_proxy_recycler1,  false);
                }else{
                    helper.setGone(R.id.tax_userbase_proxy_recycler1_txt,  false);
                    helper.setVisible(R.id.tax_userbase_proxy_recycler1,  true);
                }

                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.tax_userbase_proxy_recycler2);
                mImgRecyclerView2.setNestedScrollingEnabled(false);

                mImgAdapter2 = new FileAdapter(getActivity(), mImgList2);
                mImgRecyclerView2.setLayoutManager(mImgAdapter2.createLayoutManager());
                mImgRecyclerView2.setAdapter(mImgAdapter2);
                mImgList2.clear();

                if (info.getProvidePowerAttorneyAttas() != null) {
                    mImgList2.addAll(info.getProvidePowerAttorneyAttas());

                }


//                    mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.tax_userbase_proxy_recycler2);
//                    mImgRecyclerView2.setNestedScrollingEnabled(false);
//
//
//                    FullyGridLayoutManager manager2 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                    mImgRecyclerView2.setLayoutManager(manager2);
//                    mImgAdapter2 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                    mImgList2.clear();
//                    mImgAdapter2.setList(mImgList2);
//                    mImgRecyclerView2.setAdapter(mImgAdapter2);
//
//                    if (info.getProvidePowerAttorneyAttas() != null) {
//                        for (int i = 0; i < info.getProvidePowerAttorneyAttas().size(); i++) {
//                            TaskAtta atta = info.getProvidePowerAttorneyAttas().get(i);
//                            JSONObject obj = new JSONObject();
//                            try {
//                                obj.putOpt("filename", atta.getAttachmentName());
//                                obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                                obj.putOpt("filesize", atta.getAttachmentSize());
//                                obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                                mImgList2.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                                BaseCreateActivity.sorFiles(mImgList2, true);
//                            } catch (JSONException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }

                if("1".equalsIgnoreCase(info.getProvidePowerAttorney().getValue()))
                {
                    helper.setVisible(R.id.tax_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.tax_userbase_proxy_recycler2_txt,  "线下提供");
                    helper.setGone(R.id.tax_userbase_proxy_recycler2,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.tax_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.tax_userbase_proxy_recycler2_txt,  "已提供");
                    helper.setGone(R.id.tax_userbase_proxy_recycler2,  false);
                }else{
                    helper.setGone(R.id.tax_userbase_proxy_recycler2_txt,  false);
                    helper.setVisible(R.id.tax_userbase_proxy_recycler2,  true);
                }
            }



//            if(info!= null || info.getIdentityBigTypes() != null && "0".equalsIgnoreCase(info.getIdentityBigTypes().getValue()) && "0".equalsIgnoreCase(info.getIdentitySmallTypes().getValue()))
//            {
//                helper.setGone(R.id.base_2,false);
//                helper.setVisible(R.id.group_userbase_show,true);
//                helper.setText(R.id.tv_zq_name,info.getCreditorName());
//                //注意，这里缺判断
//                if("1".equalsIgnoreCase(info.getProcessStatus().getValue()) && "0".equalsIgnoreCase(info.getIdentityStatus().getValue())) {
//                    helper.setVisible(R.id.btn_commit, true);
//                    helper.addOnClickListener(R.id.btn_commit);
//                }else{
//                    helper.setGone(R.id.btn_commit, false);
//                    helper.addOnClickListener(R.id.btn_commit);
//                }
//            }

            mImgRecyclerView10 = (RecyclerView) helper.getView(R.id.recycler10);
            mImgRecyclerView10.setNestedScrollingEnabled(false);

            mImgAdapter10 = new FileAdapter(getActivity(), mImgList10);
            mImgRecyclerView10.setLayoutManager(mImgAdapter10.createLayoutManager());
            mImgRecyclerView10.setAdapter(mImgAdapter10);
            mImgList10.clear();

            if (info.getChangeProveAttas() != null) {
                mImgList10.addAll(info.getChangeProveAttas());

            }

            mImgRecyclerView11 = (RecyclerView) helper.getView(R.id.recycler11);
            mImgRecyclerView11.setNestedScrollingEnabled(false);

            mImgAdapter11 = new FileAdapter(getActivity(), mImgList11);
            mImgRecyclerView11.setLayoutManager(mImgAdapter11.createLayoutManager());
            mImgRecyclerView11.setAdapter(mImgAdapter11);
            mImgList11.clear();

            if (info.getOtherfilesAttas() != null) {
                mImgList11.addAll(info.getOtherfilesAttas());

            }

            helper.setText(R.id.tv_change_desc,info.getChangeDetail());
            helper.setVisible(R.id.btn_commit,false);
        }
    }

    public void getData( ) {
        String userToken = SPUtils.getInstance(Consts.SPNAME).getString("userToken","");
        Network
                .getAPIService()
                .creditorInfo(userToken,mProid,creditorId,0)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseSubscriber<JsonObject>() {
                    @Override
                    public void onNext(JsonObject json) {
                        int code = json.get("code").getAsInt();
                        if (code != 0) {
//                            super.onNext(json);
                            return;
                        }
                        zqUserDetailInfo.clear();
                        getActivity().runOnUiThread(new Runnable() {

                            @Override
                            public void run() {
                                mAdapter.notifyDataSetChanged();
                            }

                        });

                        JsonObject data = json.getAsJsonObject("data");


                        ZQUserDetailBaseInfo info = new Gson().fromJson(data.getAsJsonObject("creditorInfo"),ZQUserDetailBaseInfo.class);
                        info.setOpStatus(data.get("opStatus").getAsString());
                        zqUserDetailInfo.add(info);
                        getActivity().runOnUiThread(new Runnable() {

                            @Override
                            public void run() {

                                mAdapter.notifyDataSetChanged();
                            }

                        });

                    }

                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {
                    }
                });
    }


    public void setUserSetting() {
        String userToken = SPUtils.getInstance(Consts.SPNAME).getString("userToken", "");
        Network
                .getAPIService()
                .generateVirtualAccount(userToken, mProid, creditorId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseSubscriber<JsonObject>() {
                    @Override
                    public void onNext(JsonObject json) {
                        int code = json.get("code").getAsInt();
                        if (code != 0) {
                            super.onNext(json);
                            return;
                        }
                        ToastUtil.showShort("生成成功");
                        getActivity().runOnUiThread(new Runnable() {

                            @Override
                            public void run() {

                                getData();
                            }

                        });

                    }

                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {
                    }
                });
    }

    private String hideMidText(String text) {
        String tmp = "";
        if(text == null)
        {
            return "";
        }
        if (text.length() > 10) {
            tmp = text.substring(0, 6) + "******" + text.substring(text.length() - 4, text.length());

        } else {
            tmp = text;
        }
        return tmp;
    }

}
